<template>
  <div class='contain'>
    <div v-for="(item,index) in keylist" :key="index">{{item}}</div>
    <div v-for="(item) in valueList" :key="item">{{item}}</div>
  </div>
</template>
<script>
  import helper from '../../service/helper.js';
  import parameter from '../../service/state.js';
  export default {
    data() {
      return {
          num1:"",
          num2:"",
          keylist:[],
          valueList:[],
          obj:{
              '姓名':"1号数据",
              '年龄':"24",
              '喜好':'css',
              '座右铭':'就是这样的',
          }
      };
    },
    components: {

    },
    methods: {
        myf(obj){
            Object.keys(obj).forEach((ele,index)=>{
                    this.keylist.push(ele)
            })
            // console.log(Object.values(obj));
            Object.values(obj).forEach((ele,index)=>{
                   this.valueList.push(ele)
            })
            Reflect.ownKeys(obj).forEach((ele)=>{
                // console.log(ele,obj[ele]);
            })
            for(var i in obj){
                console.log(i,':',obj[i]);
            }
            Object.getOwnPropertyNames(obj).forEach((ele)=>{
                console.log(ele,obj[ele]);
            })
        }
    },
    watch: {

    },
    mounted() {
        var that = this
        that.myf(that.obj)
    },
};
</script>
<style scoped>

</style>